/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package consumo.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Carlos Taschetto
 */
@Entity
@Table(name = "pis_cofins", catalog = "consumodb", schema = "")
@NamedQueries({
    @NamedQuery(name = "PisCofins.findAll", query = "SELECT p FROM PisCofins p"),
    @NamedQuery(name = "PisCofins.findById", query = "SELECT p FROM PisCofins p WHERE p.id = :id"),
    @NamedQuery(name = "PisCofins.findByMes", query = "SELECT p FROM PisCofins p WHERE p.mes = :mes"),
    @NamedQuery(name = "PisCofins.findByPis", query = "SELECT p FROM PisCofins p WHERE p.pis = :pis"),
    @NamedQuery(name = "PisCofins.findByCofins", query = "SELECT p FROM PisCofins p WHERE p.cofins = :cofins")})
public class PisCofins implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Column(name = "mes")
    @Temporal(TemporalType.DATE)
    private Date mes;
    @Column(name = "pis", precision = 10, scale = 6)
    private BigDecimal pis;
    @Column(name = "cofins", precision = 10, scale = 6)
    private BigDecimal cofins;
    @JoinColumn(name = "conce", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Concessionaria conce;

    public PisCofins() {
    }

    public PisCofins(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getMes() {
        return mes;
    }

    public void setMes(Date mes) {
        this.mes = mes;
    }

    public BigDecimal getPis() {
        return pis;
    }

    public void setPis(BigDecimal pis) {
        this.pis = pis;
    }

    public BigDecimal getCofins() {
        return cofins;
    }

    public void setCofins(BigDecimal cofins) {
        this.cofins = cofins;
    }

    public Concessionaria getConce() {
        return conce;
    }

    public void setConce(Concessionaria conce) {
        this.conce = conce;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PisCofins)) {
            return false;
        }
        PisCofins other = (PisCofins) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "consumo.persistence.PisCofins[id=" + id + "]";
    }

}
